package com.manage.service.impl;

import com.manage.dao.IStudentDao;
import com.manage.domain.Student;
import com.manage.service.IStudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class StudentServiceImpl implements IStudentService {

    @Autowired
    private IStudentDao studentDao;

    @Override
    public List<Student> list() {
        return studentDao.list();
    }

    @Override
    public void add(Student s) { studentDao.insert(s); }

    @Override
    public void update(Student s) { studentDao.update(s); }

    @Override
    public void delete(Integer id) { studentDao.deleteBatch(java.util.Collections.singletonList(id)); }
}


